{% extends "WebConsole/base.html" %}

{% block content %}

<div class="row placeholders watcher-show-block">
  <div id="server-title"><h4>The machine on {{ http_host }}</h4></div>
  <div><hr style=" height:1px;border:none;border-top:1px solid ;" /></div>
  <table class="table table-striped table-condensed">
      <thead>
        <tr>
          <th>Machine</th>
          <th>组件名称</th>
          <th>cid</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        {% for comp in KBEComps %}
        <tr>
          <td>{{ comp.intaddr }}</td>
          <td>{{ comp.fullname }}</td>
          <td>{{ comp.componentID }}</td>
          <td><a href="#" onClick="connect_to('{{comp.componentType}}', '{{comp.intport}}', '{{ comp.intaddr }}','root','Watcher with {{ comp.fullname }} on {{ comp.intaddr }}:{{ comp.intport }}')">连接到控制台</a></td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
</div>
{% endblock %}

{% block tail_js %}
<script>$(".watcher-cp").addClass("active");</script>
<script>
  $(".kbe-list .dd").hide();
  $(".kbe-list .watcher .dd").show();
  $(".kbe-list .watcher").css({"background-color":"#317eb4"});
  $(".kbe-list .watcher").find('li').addClass("menu_chioce");
    function connect_to(cp, port, host, key, title)
    {
        window.location.href='/wc/watcher/connect?cp=' + cp + "&port=" + port + "&host="+ host + "&key="+key+"&title="+escape(title);
        // layer.load(2);
    }
   
</script>
    
{% endblock %}
